package com.summer.data.demo.controller;

import com.summer.data.demo.tables.StudentTable;
import com.summer.data.spring.SessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    SessionTemplate sessionTemplate;

    @GetMapping("/ping")
    public boolean ping() {
        return true;
    }

    @GetMapping("/init")
    public boolean init() {
        sessionTemplate.migrate(StudentTable.class);
        return true;
    }

}
